import React, { Component } from 'react'
import { Link, withRouter } from 'react-router-dom'
import './Header.less'
class header extends Component {
  render() {
    // console.log(this.props);
    let {back,register,title} = this.props
    return (
      <div className='header'>
          {back ? (<div className='back' onClick={()=>{
            this.props.history.go(-1);
          }}>&lt;</div>) : (<div></div>)}
          <div className='text'>{title}</div>
          { register ?  (<Link to='/register' className='register'>注册</Link>) : (<div></div>)}
      </div>
    )
  }
}
export default withRouter(header)
